#pragma once

#include "CollisionHelper.h"
#include "Point.h"

namespace model
{
class TimeBoxHelper : public CollisionHelper
{
public:
	TimeBoxHelper(std::map<int, Entity*> &activeEntities, std::map<int, Entity*> &passiveEntities, int threshold=2);
	TimeBoxHelper(int threshold=2);
	virtual ~TimeBoxHelper(void);

	void addActiveEntity (Entity* e);
	void addPassiveEntity(Entity* e);

	void removeEntity(Entity* e);

	void checkCollisions(double currentTime, std::list<Collision> &collisions, std::map<std::pair<int, int>, bool> &trackedCollisions);

private:

	std::vector<std::pair<Point*, Entity*> > previousPassiveEntityPositionVector, previousActiveEntityPositionVector;
	int threshold;
};
};